//
//  MTestViewController.m
//  MMsgDistribute_Example
//
//  Created by mal on 2019/10/13.
//  Copyright © 2019 295011445@qq.com. All rights reserved.
//

#import "MTestViewController.h"
#import <MMsgDistributeProxy.h>
#import "MScrollViewDelegateObj.h"

@interface MTestViewController ()<UIScrollViewDelegate>

@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
@property (nonatomic, strong) MMsgDistributeProxy<UIScrollViewDelegate> *scrollViewProxy;

@end

@implementation MTestViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setUpView];
}

- (void)setUpView
{
    self.scrollView.contentSize = CGSizeMake(0, 1500);
    
    self.scrollViewProxy = (MMsgDistributeProxy<UIScrollViewDelegate> *)m_distributeProxy(self, [MScrollViewDelegateObj new]);
    self.scrollView.delegate = self.scrollViewProxy;
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    NSLog(@"%@ scrollViewDidScroll", NSStringFromClass(self.class));
}

- (void)dealloc
{
    NSLog(@"%@ dealloc", NSStringFromClass(self.class));
}

@end
